package vn.fpt.fsoft.entities;



import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * @author MinhNC7
 * 
 */
@Entity
@Table(name ="OpeningTime")
public class OpeningTime {
	private int openingTimeID;
	private TBWeekday weekday;
	private String startTime;
	private String  endTime;
	private Premise premise;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public int getOpeningTimeID() {
		return openingTimeID;
	}

	public void setOpeningTimeID(int openingTimeID) {
		this.openingTimeID = openingTimeID;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "WeekdayId", nullable = true)
	public TBWeekday getWeekday() {
		return weekday;
	}

	public void setWeekday(TBWeekday weekday) {
		this.weekday = weekday;
	}


	@Column(name = "StartTime")
	public String  getStartTime() {
		return startTime;
	}

	public void setStartTime(String  startTime) {
		this.startTime = startTime;
	}

	
	@Column(name = "EndTime")
	public String  getEndTime() {
		return endTime;
	}

	public void setEndTime(String  endTime) {
		this.endTime = endTime;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PremiseID", nullable = true)
	public Premise getPremise() {
		return premise;
	}

	public void setPremise(Premise premise) {
		this.premise = premise;
	}

	public OpeningTime(int openingTimeID, TBWeekday weekday, String  startTime,
			String  endTime, Premise premise) {
		this.openingTimeID = openingTimeID;
		this.weekday = weekday;
		this.startTime = startTime;
		this.endTime = endTime;
		this.premise = premise;
	}

	public OpeningTime() {
	}

}
